#include "../include/double_Sql_list.h"
#include "../include/file.h"
#include "../include/log_in.h"

Log_in_data data[3] =
    {
        {.name = "刘备", .password = "123", .id = 0},
        {.name = "关羽", .password = "123", .id = 0},
        {.name = "张飞", .password = "123", .id = 0}};

void test_2(void)
{
}

int main(int argc, char const *argv[])
{
    test_1();
    return 0;
}

void test_1(void)
{
    // 对链表进行初始化
    Double_Link_List *dom_list = init_double_link_list();  // 普通用户
    Double_Link_List *root_list = init_double_link_list(); // 管理员用户

    // 数据的载入
    F_scanf(dom_list, "2_dom_data.txt");
    F_scanf(root_list, "1_root_data.txt");

    int num = 0;
    printf("1:进入登陆\t 2:进入注册");
    scanf("%d", &num);

    switch (num)
    {
    case 1:
        log_in(dom_list, root_list);
        break;
    case 2:
        reg(dom_list);
        break;
    default:
        break;
    }

    

    // 释放链表
    free_double_link_list(&dom_list);
    free_double_link_list(&root_list);
}